﻿(function($) {
    // 改变默认配置
    var d = $.dialog.defaults;
    // 预缓存皮肤，数组第一个为默认皮肤
    d.skin = ['chrome', 'aero'];
    // 是否开启特效
    d.effect = true;
    // 指定超过此面积的对话框拖动的时候用替身
    d.showTemp = 100000;

})(art);

function ShowValidateAlert(message, focusControl) {
    art.dialog({
        id: 'testID',
        content: message,
        icon: 'alert',
        skin: 'chrome',
        time: 3,
        yesFn: function() {
            return true;
        },
        closeFn: function() {
            focusControl.focus();
            return true;
        }
    });
}

function ShowAlert(message) {
    art.dialog({
        id: 'testID',
        content: message,
        icon: 'succeed',
        skin: 'chrome',
        yesFn: function() {
            return true;
        }
    });
}

function ShowAlert(message, time) {
    art.dialog({
        id: 'testID',
        content: message,
        icon: 'succeed',
        skin: 'chrome',
        time: time,
        yesFn: function() {
            return true;
        }
    });
}

function ShowErrorAlert(message) {
    art.dialog({
        id: 'testID',
        content: message,
        icon: 'error',
        skin: 'chrome',
        time: 3,
        yesFn: function() {
            return true;
        }
    });
}


//弹出窗口后跳转
function ShowAlertEndJump(message, url) {
    art.dialog({
        id: 'testID',
        content: message,
        icon: 'succeed',
        skin: 'chrome',
        yesFn: function() {
            window.location.href = url;
            return false;
        }
    });
}

//弹出提示窗口 1.5秒后消失
function ShowTip(message) {
    art.dialog.tips("<div style=\"width: 370px; height: 90px; border: 1px solid #608DBA; background-color: #FFFFFF;\"><ul style=\"list-style-type: none; margin: 0; padding: 0px;\"><li style=\"background-color: #82A6CC; height: 24px; color: #FFFFFF; font-size: 12px; font-weight: bold; padding-left: 5px; line-height: 24px; list-style-type: none;\">工控家园提示</li><li style=\"height: 66px; line-height: 66px;\"><span style=\"width: 70px; float: left; padding:10px 0 0 15px;\"><img src=\"http://src.gongkong.com/js/skin/chrome/ok_ico.gif\" /></span><span style=\"width: 280px; color: #6688B5; font-size: 12px; font-weight: bold;\">" + message + "</span></li></ul></div>", 1.5);
}